<html>
<body>
<style>
    dd ul li{
        float: left;
        padding: 10px;
    }
    dd ul li .hovered{
        color: red;
    }
</style>
<?php if (is_array($goods['spec_name'])) { ?>
<hr/>
<?php foreach ($goods['spec_name'] as $key => $val) {?>
<dl nctype="nc-spec" id="spec">
    <dt><?php echo $val;?></dt>
    <dd>
        <?php if (is_array($goods['spec_value'][$key]) and !empty($goods['spec_value'][$key])) {?>
        <ul nctyle="ul_sign">
        <?php foreach($goods['spec_value'][$key] as $k => $v) {?>
        <?php if( $key == 1 ){?>

        <!-- 图片类型规格-->
            <li class="sp-img"><a href="javascript:void(0);" class="<?php if (isset($goods['goods_spec'][$k])) {echo 'hovered';}?>" data-param="{valid:<?php echo $k;?>}" title="<?php echo $v;?>"><?php echo $v;?><i></i></a></li>
        <?php }else{?>
        <!-- 文字类型规格-->

            <li class="sp-txt"><a href="javascript:void(0)" class="<?php if (isset($goods['goods_spec'][$k])) { echo 'hovered';} ?>" data-param="{valid:<?php echo $k;?>}"><?php echo $v;?><i></i></a></li>
            <?php }?>
            <?php }?>
        </ul>
        <?php }?>
    </dd>
</dl>
<?php }?>
<?php }?>

<script>
    //拼出spec_id 然后进去跳转
    $(".li", "#spec").bind("click", function () {

    });
</script>

</body>

</html>